# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "E生平安·百万医"
    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):
            data["name"] = self.name
            data["company"] = "平安保险"
            data["year"] = item["year"]
            data["socialSec"] = item["socialSec"]
            data["generalMedical"] = str( int(int(item["generalMedical"])/10000)) + "w" if  item["generalMedical"] != "" else ""
            data["specialMedical"] = str(int(int(item["specialMedical"])/10000)) + "w" if item["specialMedical"] != "" else ""
            data["extSerious"] = str(int(int(item["extSerious"])/10000)) + "w" if item["extSerious"] != "" else ""
            data["cancerMedical"] = str(int(int(item["cancerMedical"])/10000)) + "w" if item["cancerMedical"] != "" else ""
            data["AsiaMedical"] = str(int(int( item["AsiaMedical"])/10000))+"w" if item["AsiaMedical"] != "" else ""
            data["expire"] = item["expire"]
            data["payType"] = item["payType"]
            data["price"] = item["price"]
            Helper.mergeTable( self.name,self.mysql,data )
